package com.javaDemo.designpattern.zerenlian;

public class ResponsibilityTest {
    public static void main(String[] args) {

        LeaveRequest request = LeaveRequest.builder().leaveDays(10).name("小明").build();

        AbstractLeaveHandler directLeaderLeaveHandler = new DirectLeaderLeaveHandler("县令");
        DeptManagerLeaveHandler deptManagerLeaveHandler = new DeptManagerLeaveHandler("知府");
        GManagerLeaveHandler gManagerLeaveHandler = new GManagerLeaveHandler("京兆尹");

        directLeaderLeaveHandler.setNextHandler(deptManagerLeaveHandler);
        deptManagerLeaveHandler.setNextHandler(gManagerLeaveHandler);
        directLeaderLeaveHandler.handlerRequest(request);


    }
}